package com.easygo.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("tb_goods")
//@Document 文档对象 （索引信息、文档类型 ）
@Document(indexName="xcgoods",type="goods")
public class Goods implements Serializable {
  private static final long serialVersionUID = 1L;

  //@Id 文档主键 唯一标识
  @Id
  //@Field 每个文档的字段配置（类型、是否分词、是否存储、分词器 ）
  @Field(store=true, index = false,type = FieldType.Long)
  @TableId(value = "id",type = IdType.AUTO)
  private Long id;
  @TableField("seller_id")
  private String sellerId;
  @TableField("goods_Name")
  @Field(index=true,analyzer="ik_max_word",store=true,searchAnalyzer="ik_max_word",type = FieldType.Text)
  private String goodsName;
  @TableField("default_item_id")
  private Long defaultItemId;
  @TableField("audit_status")
  private String auditStatus;
  @TableField("is_marketable")
  private String isMarketable;
  @TableField("brand_id")
  @Field(store=true, index = false,type = FieldType.Long)
  private Long brandId;

  @Field(index=true,analyzer="ik_max_word",store=true,searchAnalyzer="ik_max_word",type = FieldType.Text)
  private String caption;
  @TableField("category1_id")
  private Long category1Id;
  @TableField("category2_id")
  private Long category2Id;
  @TableField("category3_id")
  private Long category3Id;
  @TableField("small_pic")
  @Field(store=true, index = false,type = FieldType.Text)
  private String smallPic;
  @Field(store=true, index = false,type = FieldType.Double)
  private Double price;
  @TableField("type_template_id")
  private Long typeTemplateId;
  @TableField("is_enable_spec")
  private String isEnableSpec;
  @TableField("is_delete")
  private String isDelete;


}
